const getters = {
  nextAge(state) {
    return state.age - 1
  },
  totalPrice(state) {
    let num = 0;
    console.log('getters');
    state.cart.forEach(item => {
      num += item.price * item.num
    })
    return num
  }
}

export default getters